package com.liao.badminton.code.myenum;

/**
 * @description: 规则等级划分类型
 * @author: TangMonk
 * @create: 2024-11-09 13:40
 **/
public enum StipulationTypeEnum {
    WIN_RATE(1, "按胜率"),
    AWARD_NUM(2, "按奖励数量"),
    RANK_NUM(3, " 按排名; 排名排序规则:1胜率排行。2奖励数排行，3净胜排行"),
    ;
    private Integer code;
    private String desc;

    StipulationTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
    public static StipulationTypeEnum getEnum(Integer code) {
        for (StipulationTypeEnum stipulationTypeEnum : StipulationTypeEnum.values()) {
            if (stipulationTypeEnum.getCode().equals(code)) {
                return stipulationTypeEnum;
            }
        }
        return null;
    }

}
